<?php
/**
 * RoleModel
 *
 * @Description 描述
 * @Author look
 * @CreateTime 2022/2/21
 */

namespace app\common\model\sys;

use app\common\base\ModelBase;

/**
 * Class RoleModel
 */
class RoleModel extends ModelBase {

    protected $table = "sys_role";

    public function getRolesByAdmin(int $admin_id) {
         return $this->alias('R')
             ->field('R.id,R.name,R.data_scope')
            ->join('sys_admin_role AR', 'AR.role_id = R.id')
            ->where('AR.id', '=', $admin_id)
            ->select();
    }
}